package com.song.pj.brand.dao;


import com.song.pj.brand.pojo.Brand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface BrandsDao {
//    @Select("<script>" +
//            "select *  from tb_brand " +
//            "<if test='name!=null and name!='''>" +
//            "where name like concat('%',#{name},'%')" +
//            "</if>" +
//            "</script>")
    List<Brand> findBrands(String name);
    @Delete("delete from tb_brand where id=#{id}")
    int deleteBrands(Integer id);
    int insertBrands(Brand brand);
    @Select("select * from tb_brand where id=#{id}")
    Brand  findById(Integer id);
    @Update("update tb_brand set name=#{name},remark=#{remark} where id=#{id}")
    int updateBrands(Brand brand);
}
